STEP 6: Let's fill in the add_player() function. Remember to add new function code below the docstring!

  • Click on GRAPHICS. Go to and place Player 1 within add_player().
  • Change the name of the sprite to player. Position the player sprite at (0, -155).
  • Click on LOGIC. Go to . On the last line of main(), drag Function Call into Variable.
  • Change my_var to player and change the function from my_function() to add_player().

To navigate the page using the TAB key, first press ESC to exit the code editor.

def set_stage(): """ Sets up the stage for the game """ stage.set_background("soccerfield") stage.disable_floor() def add_player(): """ Adds a player to the stage for the user to control """ def main(): """ Sets up the program and calls other functions """ set_stage() main()
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)